package org.example.gradleadmin.rpc.rest;

import gradle.common.core.mode.entity.SystemUser;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.gradleadmin.rpc.service.SystemUserRestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/service/user")
public class SystemUserRest {

    @Resource
    private SystemUserRestService systemUserRestService;

    @GetMapping("/loadUserByUsername")
    public SystemUser loadUserByUsername(@RequestParam("username") String username){

        return systemUserRestService.loadUserByUsername(username);
    }

}
